package top.yueyazhui.vhr.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import top.yueyazhui.vhr.mapper.HrRoleMapper;

@Service
public class HrRoleService {

    @Autowired
    HrRoleMapper hrRoleMapper;

    @Transactional
    public boolean update(Integer hrId, Integer[] rids) {
        hrRoleMapper.deleteByHrId(hrId);
        if(rids != null) {
            return hrRoleMapper.insertRecord(hrId, rids) == rids.length;
        }
        return true;
    }
}
